#nprogress {
  pointer-events: none;
}

#nprogress .bar {
  background: rgb(var(--color-primary));
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
}

#nprogress .peg {
  display: block;
  position: absolute;
  right: 0px;
  width: 100px;
  height: 100%;
  box-shadow: 0 0 10px rgb(var(--color-primary)),
    0 0 5px rgb(var(--color-primary));
  opacity: 1;
  -webkit-transform: rotate(3deg) translate(0px, -4px);
  -ms-transform: rotate(3deg) translate(0px, -4px);
  transform: rotate(3deg) translate(0px, -4px);
}

#nprogress .spinner {
  display: block;
  position: fixed;
  z-index: 1031;
  top: 15px;
  right: 15px;
}

#nprogress .spinner-icon {
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: solid 2px transparent;
  border-top-color: rgb(var(--color-primary));
  border-left-color: rgb(var(--color-primary));
  border-radius: 50%;
  -webkit-animation: nprogresss-spinner 400ms linear infinite;
  animation: nprogress-spinner 400ms linear infinite;
}

.nprogress-custom-parent {
  overflow: hidden;
  position: relative;
}

.nprogress-custom-parent #nprogress .spinner,
.nprogress-custom-parent #nprogress .bar {
  position: absolute;
}

@-webkit-keyframes nprogress-spinner {
  0% {
    -webkit-transform: rotate(0deg);
  }

  100% {
    -webkit-transform: rotate(360deg);
  }
}

@keyframes nprogress-spinner {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Navbar scroll behavior */
header.fixed {
  transform: translateY(0) !important;
  opacity: 1 !important;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, background-color 0.3s ease-in-out !important;
}

header.fixed.nav-hidden {
  transform: translateY(-100%) !important;
  opacity: 0 !important;
  pointer-events: none;
}

header.fixed.nav-visible {
  transform: translateY(0) !important;
  opacity: 1 !important;
  pointer-events: auto;
}

header.fixed.scrolled {
  background-color: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}

header.fixed.scrolled.text-white,
header.fixed.scrolled {
  color: #333 !important;
}

header.fixed.scrolled nav a {
  color: #333 !important;
}

header.fixed.scrolled nav a:hover {
  color: #38947e !important;
}

header.fixed.scrolled button svg,
header.fixed.scrolled svg {
  color: #333 !important;
  stroke: #333 !important;
  fill: #333 !important;
}

/* Keep pill nav styling when header is scrolled */
header.fixed.scrolled .nav-pill {
  background-color: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  color: #fff !important;
}

header.fixed.scrolled .nav-pill-links a {
  color: #e5e7eb !important;
}

header.fixed.scrolled .nav-pill-cta {
  background: #fff !important;
  color: #0f172a !important;
}

/* Logo scroll behavior */
.logo-wrapper {
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out !important;
}

.logo-wrapper.logo-hidden {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.logo-wrapper.logo-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Hamburger menu icon animation */
.line {
  fill: none;
  stroke: #4d4d4d;
  transition: stroke-dasharray 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.line,
.line1 {
  stroke-width: 6;
}

.line1 {
  stroke-dasharray: 60 207;
}

.line2 {
  stroke-dasharray: 60 60;
  stroke-width: 6;
}

.line3 {
  stroke-dasharray: 60 207;
  stroke-width: 6;
}

.opened .line1 {
  stroke-dasharray: 90 207;
  stroke-dashoffset: -134;
  stroke-width: 6;
}

.opened .line2 {
  stroke-dasharray: 1 60;
  stroke-dashoffset: -30;
  stroke-width: 6;
}

.opened .line3 {
  stroke-dasharray: 90 207;
  stroke-dashoffset: -134;
  stroke-width: 6;
}

/* Modern Navbar Enhancements */
.nav-link {
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(56, 148, 126, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: 0;
}

.nav-link:hover::before {
  width: 300px;
  height: 300px;
}

.nav-link.active::before {
  width: 300px;
  height: 300px;
}

.nav-link span {
  position: relative;
  z-index: 1;
}

/* Mobile menu link animations */
.nav-mobile-link {
  opacity: 0;
  transform: translateX(-20px);
}

#mobile-menu.opened .nav-mobile-link {
  animation: slideInLeft 0.4s ease forwards;
}

#mobile-menu.opened .nav-mobile-link:nth-child(1) { animation-delay: 0.1s; }
#mobile-menu.opened .nav-mobile-link:nth-child(2) { animation-delay: 0.15s; }
#mobile-menu.opened .nav-mobile-link:nth-child(3) { animation-delay: 0.2s; }
#mobile-menu.opened .nav-mobile-link:nth-child(4) { animation-delay: 0.25s; }
#mobile-menu.opened .nav-mobile-link:nth-child(5) { animation-delay: 0.3s; }
#mobile-menu.opened .nav-mobile-link:nth-child(6) { animation-delay: 0.35s; }

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Mobile menu indicator bar animation */
.nav-mobile-link:hover .w-1,
.nav-mobile-link.active .w-1 {
  opacity: 1 !important;
  animation: expandHeight 0.3s ease forwards;
}

@keyframes expandHeight {
  from {
    height: 0;
  }
  to {
    height: 1.5rem;
  }
}

/* Enhanced mobile menu backdrop */
#mobile-menu {
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

#mobile-menu.opened {
  animation: fadeInBackdrop 0.3s ease forwards;
}

@keyframes fadeInBackdrop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Smooth underline animation for desktop nav */
.nav-link .absolute {
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo hover glow effect */
.logo-wrapper .group:hover .absolute {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

/* Improved scroll behavior with smoother transitions */
header.fixed {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              background-color 0.3s ease-in-out,
              backdrop-filter 0.3s ease-in-out,
              box-shadow 0.3s ease-in-out !important;
}

/* Active link styling for desktop */
.nav-link.active {
  color: #38947e !important;
}

header.fixed.scrolled .nav-link.active {
  color: #38947e !important;
}